package org.cx.base;

import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * 定义装载实体对象
 * 
 * @author Hungel.zou
 * @time 2015年6月8日 下午8:20:36
 * @param <T>
 */

@io.swagger.annotations.ApiModel("实体对象")
public class ApiModel<T>  implements Serializable{


	private static final long serialVersionUID = -4235000009767703449L;
	
	@ApiModelProperty(value = "返回状态(0:成功；-1：失败；-2：异常出错。)",dataType = "String")
	private String status;

	@ApiModelProperty(value = "返回描述",dataType = "String")
	private String errorMsg;

	@ApiModelProperty(value = "返回内容")
	private T body;

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getErrorMsg() {
		return errorMsg;
	}

	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}

	public T getBody() {
		return body;
	}

	public void setBody(T body) {
		this.body = body;
	}

	@Override
	public String toString() {
		return "ApiModel [status=" + status + ", errorMsg=" + errorMsg
				+ ", body=" + body + "]";
	}

	public ApiModel(String status, String errorMsg, T body) {
		super();
		this.status = status;
		this.errorMsg = errorMsg == null ? errorMsg : "";
		this.body = body;
	}

	public ApiModel() {
		super();
	}

}
